package net.zjitc.mapper;

import net.zjitc.pojo.Bill;
import net.zjitc.pojo.BillItem;
import net.zjitc.pojo.Customer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface BillMapper {
    @Select("select * from bill where customerId=#{customerId}")
    List<Bill> selectBillByCustomerId(@Param("customerId") Long customerId);

    @Select("select * from billItem where billId = #{billId}")
    List<BillItem> selectBillItemsByBillId(@Param("billId") Long billId);

    @Update("update bill set totalPrice =#{totalPrice} where id =#{id}")
    Bill updateBill(@Param("totalPrice")BigDecimal totalPrice,@Param("id") Long id);

}
